package com.zjw.service.impl;

import com.zjw.dao.impl.TypeDaoImpl;
import com.zjw.entity.Type;
import com.zjw.dao.TypeDao;
import com.zjw.service.TypeService;
import com.zjw.utils.ConnectionUtil;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * 好物类别表(Type)表服务实现类
 *
 * @author 翟
 * @since 2025-04-09 08:59:19
 */
public class TypeServiceImpl implements TypeService {

    @Override
    public List<Type> findAll() {
        Connection conn = ConnectionUtil.getConnection();
        TypeDao typeDao = new TypeDaoImpl(conn);
        try {
           return typeDao.selectAll();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            ConnectionUtil.closeALL(null , null , conn);
        }
        return null;
    }
}
